<?php //pack11class

class ObjectsListItemHeaderLeft extends Module {

    public $traceEnabled=true;
    protected $object;

    public function setup() {
        //echo "ObjectsListItemHeaderLeft parent: ".$this->parent;
        $object=$this->object=$this->parent->getObject();
        $properties=$object->usedProperties();
        $propertiesArray=array();
        foreach($properties as $property) {
            if(!$property->combined && $property->group=="address") {
                array_push($propertiesArray,$property->string);
            }
        }

        $settingObject=SettingsManager::getSetting("object");
        $setting=clone $settingObject;
        $setting->value=$object->id;
        $queryObject=new GetQueryObject;
        $queryObject->setValue($setting, GetQueryObject::SETTING);

        $currencyObject=SettingsManager::getSetting("currency");
        //trace("LIST CURRENCY: ".$currencyObject->value);
        $queryObject->setValue($currencyObject, GetQueryObject::SETTING);

        $query=GetQuery::generate($queryObject);
//.$object->id." "
        $this->setBody("<a href='?state=$query'>".implode(", ",$propertiesArray)."</a>");
    }

}
?>
